package cn.hy.enums;


public enum OrderStatusEnum {
    // 待支付	pay_wait 0
    // 部分支付	pay_part 5
    // 已支付	pay_over 10
    // 待发货待授权	send_wait 15
    // 部分发货		send_part 20
    // 已发货全部发货	send_over 25
    // 已完成（全部收到货）finished 30 25
    // 已发起售后申请 aftermarket_apply 35
    // 部分退款	refund_part 40 15
    // 已关闭	closed 100

    PAY_WAIT(0, "PAY_WAIT"),
    PAY_PART(5, "PAY_PART"),
    PAY_OVER(10, "PAY_OVER"),
    SEND_WAIT(15, "SEND_WAIT"),
    SEND_PART(20, "SEND_PART"),
    SEND_OVER(25, "SEND_OVER"),
    FINISHED(30, "FINISHED"),
    AFTERMARKET_APPLY(35, "AFTERMARKET_APPLY"),
    REFUND_PART(40, "REFUND_PART"),
    CLOSED(100, "CLOSED"),
    ;


    private final Integer code;
    private final String type;

    public Integer getCode() {
        return this.code;
    }

    public String getType() {
        return this.type;
    }

    OrderStatusEnum(Integer code, String type) {
        this.code = code;
        this.type = type;
    }

    public static OrderStatusEnum getByCode(Integer code) {
        for (OrderStatusEnum saleOrderStatusEnum : values()) {
            if (saleOrderStatusEnum.getCode().equals(code)) {
                return saleOrderStatusEnum;
            }
        }
        return null;
    }

}
